﻿using CID.Domain.Exceptions;
using CID.Domain.Infrastructure;
using NUnit.Framework;

namespace CID.Domain.Tests.Infrastructure.ParameterValue
{
    [TestFixture]
    class BooleanParameterValueTests : BaseParameterValueTests
    {
        public override void SetUp()
        {
            base.SetUp();
            CreateParameterValue(ParameterType.Boolean);
        }

        [Test, ExpectedException(typeof(InvalidParameterValueTypeException))]
        public override void GetStringValue()
        {
            base.GetStringValue();
        }

        [Test, ExpectedException(typeof(InvalidParameterValueTypeException))]
        public override void SetStringValue()
        {
            base.SetStringValue();
        }

        [Test, ExpectedException(typeof(InvalidParameterValueTypeException))]
        public override void GetIntegerValue()
        {
            base.GetIntegerValue();
        }

        [Test, ExpectedException(typeof(InvalidParameterValueTypeException))]
        public override void SetIntegerValue()
        {
            base.SetIntegerValue();
        }

        [Test, ExpectedException(typeof(InvalidParameterValueTypeException))]
        public override void GetDecimalValue()
        {
            base.GetDecimalValue();
        }

        [Test, ExpectedException(typeof(InvalidParameterValueTypeException))]
        public override void SetDecimalValue()
        {
            base.SetDecimalValue();
        }

        [Test, ExpectedException(typeof(InvalidParameterValueTypeException))]
        public override void GetDateTimeValue()
        {
            base.GetDateTimeValue();
        }

        [Test, ExpectedException(typeof(InvalidParameterValueTypeException))]
        public override void SetDateTimeValue()
        {
            base.SetDateTimeValue();
        }

        [Test]
        public override void GetBooleanValue()
        {
            ParameterValue.BooleanValue = BooleanValue;

            base.GetBooleanValue();

            Assert.AreEqual(BooleanValue, booleanValue);
        }

        [Test]
        public override void SetBooleanValue()
        {
            base.SetBooleanValue();

            Assert.AreEqual(BooleanValue, ParameterValue.BooleanValue);
        }

        [Test, ExpectedException(typeof(InvalidParameterValueTypeException))]
        public override void GetUniqueIdentifierValue()
        {
            base.GetUniqueIdentifierValue();
        }

        [Test, ExpectedException(typeof(InvalidParameterValueTypeException))]
        public override void SetUniqueIdentifierValue()
        {
            base.SetUniqueIdentifierValue();
        }

        [Test, ExpectedException(typeof(InvalidParameterValueTypeException))]
        public override void GetXmlValue()
        {
            base.GetXmlValue();
        }

        [Test, ExpectedException(typeof(InvalidParameterValueTypeException))]
        public override void SetXmlValue()
        {
            base.SetXmlValue();
        }

        [Test]
        public override void CopyTo_ParameterValueForSameParameter_ShouldSucceed()
        {
            var anotherParameterValue = CreateAnotherParameterValue();
            ParameterValue.BooleanValue = BooleanValue;

            ParameterValue.CopyTo(anotherParameterValue);

            Assert.AreEqual(ParameterValue.BooleanValue, anotherParameterValue.BooleanValue);
        }
    }
}
